<!DOCTYPE html>
<html>

    <head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="江苏理工 ITE 协会全名江苏理工学院网络与开源软件协会，注册名江苏理工学院网络协会，是由江苏理工学院网络技术和开源软件爱好者、技术宅组成的团体。现阶段仅向校内提供开源软件镜像等服务。">

<link rel="shortcut icon" href="/assets/img/favicon.png">
<link type="application/atom+xml" rel="alternate" href="/feed.xml" title="江苏理工 ITE 协会" />



<!-- Open Graph metadata -->
<meta property="og:title" content="ITE MIR189 (开源镜像) 服务使用说明 | 江苏理工 ITE 协会" />
<meta property="og:description" content="江苏理工 ITE 协会全名江苏理工学院网络与开源软件协会，注册名江苏理工学院网络协会，是由江苏理工学院网络技术和开源软件爱好者、技术宅组成的团体。现阶段仅向校内提供开源软件镜像等服务。" />
<meta property="og:image" content="https://jsutite.github.io//assets/img/logo-share.png" /> <!-- WeChat requires that thumbnail image is larger than 300x300 -->
<meta property="og:url" content="https://jsutite.github.io//help/mirrors/" />

<meta property="og:type" content="website" />


<title>ITE MIR189 (开源镜像) 服务使用说明 | 江苏理工 ITE 协会</title>

<!-- Bootstrap core CSS -->
<link href="/assets/css/bootstrap.css" rel="stylesheet">

<!-- Custom styles for this template -->
<link href="/assets/css/style.css" rel="stylesheet">
<link href="/assets/css/font-awesome.min.css" rel="stylesheet">
<link href="/assets/css/font-awesome-v4-shims.min.css" rel="stylesheet">

<script src="/assets/js/jquery.min.js"></script>
<script src="/assets/js/bootstrap.min.js"></script>
</head>


    <body>
        <!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="/"><picture>
  <source srcset="/assets/img/logo-small-dark.png 1x, /assets/img/logo-small-dark@2x.png 2x, /assets/img/logo-small-dark@3x.png 3x, /assets/img/logo-small-dark@4x.png 4x" media="(prefers-color-scheme: dark)" />
  
  <img src="/assets/img/logo-small.png" srcset="/assets/img/logo-small.png 1x, /assets/img/logo-small@2x.png 2x, /assets/img/logo-small@3x.png 3x, /assets/img/logo-small@4x.png 4x" />
  </picture>
 江苏理工 ITE 协会</a>
    </div>
    <div class="navbar-collapse collapse navbar-right">
      <ul class="nav navbar-nav">
        <li ><a href="/">HOME</a></li>
        <li ><a href="/events/">EVENTS</a></li>
        <li ><a href="/blog/">BLOG</a></li>
        <li><a href="/feed.xml">RSS</a></li>
        <li><a href="https://github.com/jsutite">GITHUB</a></li>
        <li><a href="http://192.168.6.189:8000/">CTF</a></li>
      </ul>
    </div><!--/.nav-collapse -->
  </div>
</div>


            <div class="container mtb">
    <div class="row">
        <! -- SINGLE POST -->
        <div class="col-lg-12">
            <! -- Blog Post  -->
            <a href="/help/mirrors/"><h3 class="ctitle">ITE MIR189 (开源镜像) 服务使用说明</h3></a>
            <div class="post-content">
            <h3 id="服务总览">服务总览</h3>

<p>ITE 现提供一台<strong>内网</strong>开源镜像服务器。</p>

<h1 id="1921686189"><a href="http://192.168.6.189/">192.168.6.189</a></h1>

<p>受服务器性能影响，当前仅为校内提供 <code class="language-plaintext highlighter-rouge">CentOS, EPEL</code> 镜像服务。</p>

<h2 id="centos-镜像使用帮助">CentOS 镜像使用帮助</h2>

<p>该文件夹只提供 CentOS 7 与 8，架构仅为 <code class="language-plaintext highlighter-rouge">x86_64</code> ，如果需要较早版本的 CentOS，请参考清华源 <a href="https://mirrors.tuna.tsinghua.edu.cn/help/centos-vault/">centos-vault</a> 的帮助，若需要其他架构，请参考清华源 <a href="https://mirrors.tuna.tsinghua.edu.cn/help/centos-altarch/">centos-altarch</a> 的帮助。</p>

<p>建议先备份 <code class="language-plaintext highlighter-rouge">/etc/yum.repos.d/</code> 内的文件（CentOS 7 及之前为 <code class="language-plaintext highlighter-rouge">CentOS-Base.repo</code>，CentOS 8 为<code class="language-plaintext highlighter-rouge">CentOS-Linux-*.repo</code>）</p>

<p>然后编辑 <code class="language-plaintext highlighter-rouge">/etc/yum.repos.d/</code> 中的相应文件，在 <code class="language-plaintext highlighter-rouge">mirrorlist=</code> 开头行前面加 <code class="language-plaintext highlighter-rouge">#</code> 注释掉；并将 <code class="language-plaintext highlighter-rouge">baseurl=</code> 开头行取消注释（如果被注释的话），把该行内的域名（例如<code class="language-plaintext highlighter-rouge">mirror.centos.org</code>）替换为 <code class="language-plaintext highlighter-rouge">192.168.6.189</code>。</p>

<p>以上步骤可以被下方的命令一步完成</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
         -e 's|^#baseurl=http://mirror.centos.org|baseurl=http://192.168.6.189|g' \
         -i.bak \
         /etc/yum.repos.d/CentOS-*.repo
</code></pre></div></div>

<p>注意其中的<code class="language-plaintext highlighter-rouge">*</code>通配符，如果只需要替换一些文件中的源，请自行增删。</p>

<p>注意，如果需要启用其中一些 repo，需要将其中的 <code class="language-plaintext highlighter-rouge">enabled=0</code> 改为 <code class="language-plaintext highlighter-rouge">enabled=1</code>。</p>

<p>最后，更新软件包缓存</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo yum makecache
</code></pre></div></div>

<h2 id="epel-镜像使用帮助">EPEL 镜像使用帮助</h2>

<p>EPEL(Extra Packages for Enterprise Linux)是由Fedora Special Interest Group维护的Enterprise Linux（RHEL、CentOS）中经
常用到的包。</p>

<p>下面以CentOS 7为例讲解如何使用本镜像站的epel镜像。</p>

<p>首先从CentOS Extras这个源（<a href="http://192.168.6.189/centos">本镜像站</a>也有镜像）里安装epel-release：</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yum install epel-release
</code></pre></div></div>

<!-- 当前ITE已经在epel的官方镜像列表里，所以不需要其他配置，mirrorlist机制就能让你的服务器就近使用ITE的镜像。-->
<p>修改<code class="language-plaintext highlighter-rouge">/etc/yum.repos.d/epel.repo</code>，将<code class="language-plaintext highlighter-rouge">mirrorlist</code>和<code class="language-plaintext highlighter-rouge">metalink</code>开头的行注释掉。</p>

<p>接下来，取消注释这个文件里<code class="language-plaintext highlighter-rouge">baseurl</code>开头的行，并将其中的<code class="language-plaintext highlighter-rouge">http://download.fedoraproject.org/pub</code>替换成<code class="language-plaintext highlighter-rouge">http://192.168.6.189</code>。</p>

<p>可以用如下命令自动替换：（来自 https://github.com/tuna/issues/issues/687）</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sed -e 's!^metalink=!#metalink=!g' \
    -e 's!^#baseurl=!baseurl=!g' \
    -e 's!//download\.fedoraproject\.org/pub!//192.168.6.189!g' \
    -i /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel-testing.repo
</code></pre></div></div>

<p>修改结果如下：（仅供参考，不同版本可能不同）</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://192.168.6.189/epel/7/$basearch
#mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=epel-7&amp;arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=http://192.168.6.189/epel/7/$basearch/debug
#mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&amp;arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://192.168.6.189/epel/7/SRPMS
#mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=epel-source-7&amp;arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
</code></pre></div></div>

<p>运行 <code class="language-plaintext highlighter-rouge">yum update</code> 测试一下吧。</p>

            </div>
            <div class="spacing"></div>
        </div><! --/col-lg-8 -->
    </div><! --/row -->
</div><! --/container -->


        <div id="footerwrap">
    <div class="container">
        <div class="row">
            <div class="col-sm-4">
                <p>江苏理工 ITE 协会全名江苏理工学院网络与开源软件协会，注册名江苏理工学院网络协会，是由江苏理工学院网络技术和开源软件爱好者、技术宅组成的团体。现阶段仅向校内提供开源软件镜像等服务。</p>
            </div>

            <div class="col-sm-4">
              <h4>Contact Us</h4>
              <div>
                <ul class="social">
                  <!--<li>
                    <a href="https://groups.google.com/forum/#!forum/tuna-general"><i class="fa fa-envelope"></i> Mailing List </a>
                  </li>
                  <li>
                    <a href="mailto:join@tuna.tsinghua.edu.cn?subject=Request%20to%20join%20TUNA%20Telegram%20Group&body=Introduce%20yourself%20briefly%20and%20provide%20your%20Telegram%20username."><i class="fa fa-telegram"></i> Telegram (mail us to get invited) </a>
                  </li>
                  <li>
                    <a href="https://web.libera.chat/#tuna"><i class="fa fa-hashtag"></i> #tuna at Libera.Chat </a>
                  </li>-->
                  <li>
                    <a href="http://www.jsut.edu.cn/"><i class="fa fa-hashtag"></i> 江苏理工学院 </a>
                  </li>
                  <li>
                    <a href="https://github.com/jsutite/"><i class="fa fa-github"></i> GitHub </a>
                  </li>
                  <!-- <li>
                    <a href="https://secure.flickr.com/groups/tuna/"><i class="fa fa-flickr"></i> Flickr</a>
                  </li>
                  <li>
                    <a href="http://weibo.com/u/5402274706"><i class="fa fa-weibo"></i> 新浪微博</a>
                  </li> -->
                </ul>
              </div>
            </div>

            <div class="col-sm-4">
              <picture>
  <img src="/assets/img/logo-white.png" srcset="/assets/img/logo-white.png 1x, /assets/img/logo-white@2x.png 2x, /assets/img/logo-white@3x.png 3x, /assets/img/logo-white@4x.png 4x" />
  </picture>

              <p style="color: #eaeaea"> The best team on the planet. </p>
            </div>
        </div><!--/row -->
    </div><!--/container -->
</div><!--/footerwrap -->

    </body>
</html>